package palindrom;

public class palindromLogik {

	public static boolean istPalindrom(String s) {
		if (s == null) {
			throw new IllegalArgumentException("String ist null.");
		}

		s = s.toLowerCase().replace(" ", "");
		if (s.length() < 2) {
			return false;
		}
		for (int i = 0; i < s.length() / 2; i++) {
			if (s.charAt(i) != s.charAt(s.length() - (i + 1))) {
				return false;
			}
		}
		return true;
	}
}